<?php
/**
 * User:于小涛
 * Date:2020/2/17
 * Time:17:28
 */
namespace app\admin\validate\rbac;

use think\Validate;

class Login extends Validate{
    protected $rule=[
        'account'=>'require',
        'pwd'=>'require',
        'vercode'=>'require|checkCaptcha'
    ];

    protected $message=[
        'account'=>'账号不允许为空',
        'pwd'=>'密码不允许为空',
        'vercode'=>'验证码不允许为空'
    ];

    public function checkCaptcha($value,$rule,$data=[]){
        if(!captcha_check($value)){
            return '验证码错误';
        }
        return true;
    }
}